package com.wsjj.yjh.server.impl;
import com.wsjj.yjh.bean.HiveTable;
import com.wsjj.yjh.bean.JavaMysqlRedisJvmDockerTable;
import com.wsjj.yjh.mapper.HiveTableMapper;
import com.wsjj.yjh.mapper.JavaMysqlRedisJvmDockerTableMapper;
import com.wsjj.yjh.server.HiveTableServer;
import com.wsjj.yjh.server.JavaMysqlRedisJvmDockerTableServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Random;

@Service
public class JavaMysqlRedisJvmDockerTableServerImpl implements JavaMysqlRedisJvmDockerTableServer {

    @Autowired
    private JavaMysqlRedisJvmDockerTableMapper javaMysqlRedisJvmDockerTableMapper;


    @Override
    public JavaMysqlRedisJvmDockerTable selectById() {
        Integer coumt = javaMysqlRedisJvmDockerTableMapper.selectCoumt();
        Random random = new Random();
        int id = random.nextInt(coumt);

        return javaMysqlRedisJvmDockerTableMapper.selectById(id+1);
    }
}
